package com.woniuxy.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.woniuxy.pojo.Maintain;

public interface MaintainMapper {
	// 查看设施根据房间id
	@Select("SELECT * FROM maintain WHERE house_id = #{id}")
	public List<Maintain> findMaintainById(int house_id);

	// 处理损坏的设备
	@Update("UPDATE maintain SET state = 1 WHERE maintain_id = #{id}")
	public int UpdateStateByMaintainId(int maintain_id);

	// 添加设施维护--状态默认是1-未解决
	@Insert("INSERT INTO maintain VALUES (DEFAULT,#{describe},#{time},1,#{house_id})")
	public int add(Maintain maintain);
}
